package com.itheima.app.controller;

import com.itheima.app.config.R;
import com.itheima.app.service.OrderService;
import com.itheima.health.model.dtos.OrderDto;
import com.itheima.health.model.pojos.Order;
import com.itheima.health.model.vos.OrderVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.jaxb.SpringDataJaxb;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/order")
public class orderController {


    @Autowired
    private OrderService orderService;

   @PostMapping("/submit")
    public R submit(@RequestBody OrderDto dto){
      Integer id=  orderService.OrderDto(dto);
       return R.success(id);
   }

    @PostMapping("/findById")
    public R findById( Integer id){
        OrderVo vo = orderService.findById(id);
        return R.success(vo);
    }




}
